package com.tcmj.dining.service.impl;

import java.util.List;
import com.tcmj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tcmj.dining.mapper.TzDiningRoomMapper;
import com.tcmj.dining.domain.TzDiningRoom;
import com.tcmj.dining.service.ITzDiningRoomService;
import com.tcmj.common.core.text.Convert;

/**
 * 餐厅Service业务层处理
 * 
 * @author tcmj
 * @date 2020-05-17
 */
@Service
public class TzDiningRoomServiceImpl implements ITzDiningRoomService 
{
    @Autowired
    private TzDiningRoomMapper tzDiningRoomMapper;

    /**
     * 查询餐厅
     * 
     * @param diningId 餐厅ID
     * @return 餐厅
     */
    @Override
    public TzDiningRoom selectTzDiningRoomById(Long diningId)
    {
        return tzDiningRoomMapper.selectTzDiningRoomById(diningId);
    }

    /**
     * 查询餐厅列表
     * 
     * @param tzDiningRoom 餐厅
     * @return 餐厅
     */
    @Override
    public List<TzDiningRoom> selectTzDiningRoomList(TzDiningRoom tzDiningRoom)
    {
        return tzDiningRoomMapper.selectTzDiningRoomList(tzDiningRoom);
    }

    /**
     * 新增餐厅
     * 
     * @param tzDiningRoom 餐厅
     * @return 结果
     */
    @Override
    public int insertTzDiningRoom(TzDiningRoom tzDiningRoom)
    {
        tzDiningRoom.setCreateTime(DateUtils.getNowDate());
        return tzDiningRoomMapper.insertTzDiningRoom(tzDiningRoom);
    }

    /**
     * 修改餐厅
     * 
     * @param tzDiningRoom 餐厅
     * @return 结果
     */
    @Override
    public int updateTzDiningRoom(TzDiningRoom tzDiningRoom)
    {
        tzDiningRoom.setUpdateTime(DateUtils.getNowDate());
        return tzDiningRoomMapper.updateTzDiningRoom(tzDiningRoom);
    }

    /**
     * 删除餐厅对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTzDiningRoomByIds(String ids)
    {
        return tzDiningRoomMapper.deleteTzDiningRoomByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除餐厅信息
     * 
     * @param diningId 餐厅ID
     * @return 结果
     */
    @Override
    public int deleteTzDiningRoomById(Long diningId)
    {
        return tzDiningRoomMapper.deleteTzDiningRoomById(diningId);
    }
}
